package com.loongson;

import java.time.Duration;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import com.alibaba.fastjson.JSON;


public class UtilTool {
	public static long getDelay(int hour,int minute,int second){
		ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Shanghai"));
		ZonedDateTime nextRun = now.withHour(hour).withMinute(minute).withSecond(second);
		if(now.compareTo(nextRun) > 0)
		    nextRun = nextRun.plusDays(1);

		Duration duration = Duration.between(now, nextRun);
		long initalDelay = duration.getSeconds();
		return initalDelay;
	}




}
